package com.yanxin.grpc.stub.service;

import com.yanxin.grpc.proto.activity.*;
import net.devh.boot.grpc.client.inject.GrpcClient;
import org.springframework.stereotype.Service;

import java.util.Iterator;

@Service
public class RpaService {

    @GrpcClient("rpaClientService")
    private rpaGrpc.rpaBlockingStub rpaBlockingStub;

    public void run() {
        Iterator<log> run = rpaBlockingStub.run(run_args.newBuilder()
                .setId("")
                .setUrl("")
                .setIsDebug(true)
                .build());
        while (run.hasNext()) {
            log next = run.next();
            System.out.println(next.getData());
        }
        System.out.println(run);
    }
}
